#pragma once
#include <iostream>
#include <thread>
#include "Level.hpp"
#include "util.hpp"
namespace mian_yang
{
    class LogMsg
    {
    public:
        time_t _ctime;                     /*日志时间*/
        std::string _file;                 /*日志产生所在文件*/
        size_t _line;                      /*日志产生行号*/
        std::thread::id _tid;              /*日志所在线程id*/
        std::string _logger;               /*日志器名称*/
        mian_yang::LogLevel::value _level; /*日志等级*/
        std::string _payload;              /*日志信息*/
        LogMsg(){}
        LogMsg(const std::string file,
               const size_t line,
               const std::string logger,
               const mian_yang::LogLevel::value level,
               const std::string msg)
            : _ctime(mian_yang::util::Date::GetTime()),
              _file(file),
              _line(line),
              _tid(std::this_thread::get_id()),
              _logger(logger),
              _level(level),
              _payload(msg)
        {
        }
    };
}